<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.bootcdn.net/ajax/libs/art-template/4.13.2/lib/template-web.js"></script>
    <title>Document</title>
</head>
<body>
    <div id="box"></div>
    <!-- 定义模板 -->
    <script type="text/html" id="_template">
        <span>{{name}}</span>==<span>{{age}}</span>
    </script>
    <!-- 定义数据 -->
    <script type="module">
        import template from "./index.js"
        const data = {name:"sunwukong",age:20}
        const htmlStr = template(_template,data)
        document.getElementById("box").innerHTML = htmlStr
    </script>
</body>
</html>